﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace Dare.Utilities.Components
{
    public delegate void ServiceMessageEventHandler(IService service, string message);
    public delegate void ServiceErrorEventHandler(IService service, Exception ex);

    public interface IService
    {
        //事件接口
        event EventHandler Started;
        event EventHandler Stopped;
        event ServiceErrorEventHandler Error;
        event ServiceMessageEventHandler Message;

        //属性
        string ServiceKey { get;}
        string ServiceName { get;}
        string ServiceDescription { get;}
        Version ServiceVersion { get;}

        //方法
        void Start();
        void Stop();
    }
}
